summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx')
-rw-r--r--app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx78
1 files changed, 4 insertions, 74 deletions
diff --git a/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx b/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx
index aa9f33b5..973593d8 100644
--- a/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx
+++ b/app/[lng]/evcp/(evcp)/(procurement)/bid/page.tsx
@@ -4,14 +4,9 @@ import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"
import {
getBiddings,
getBiddingStatusCounts,
- getBiddingTypeCounts,
- getBiddingManagerCounts,
- getBiddingMonthlyStats,
- getUserCodeByEmail,
} from "@/lib/bidding/service"
import { searchParamsCache } from "@/lib/bidding/validation"
import { BiddingsPageHeader } from "@/lib/bidding/list/biddings-page-header"
-import { BiddingsStatsCards } from "@/lib/bidding/list/biddings-stats-cards"
import { BiddingsTable } from "@/lib/bidding/list/biddings-table"
import { getValidFilters } from "@/lib/data-table"
import { type SearchParams } from "@/types/table"
@@ -33,30 +28,13 @@ export default async function BiddingsPage(props: IndexPageProps) {
const validFilters = getValidFilters(search.filters)
- // ✅ 입찰 데이터를 먼저 가져옴
- const biddingsResult = await getBiddings({
- ...search,
- filters: validFilters,
- })
-
- // ✅ 입찰 데이터에 managerCode 추가
- const biddingsDataWithManagerCode = await Promise.all(
- biddingsResult.data.map(async (item) => {
- let managerCode: string | null = null
- if (item.managerEmail) {
- managerCode = await getUserCodeByEmail(item.managerEmail)
- }
- return { ...item, managerCode: managerCode || null }
- })
- )
-
// ✅ 모든 데이터를 병렬로 로드
const promises = Promise.all([
- Promise.resolve({ ...biddingsResult, data: biddingsDataWithManagerCode }),
+ getBiddings({
+ ...search,
+ filters: validFilters,
+ }),
getBiddingStatusCounts(),
- getBiddingTypeCounts(),
- getBiddingManagerCounts(),
- getBiddingMonthlyStats(),
])
return (
@@ -67,13 +45,6 @@ export default async function BiddingsPage(props: IndexPageProps) {
<BiddingsPageHeader />
{/* ═══════════════════════════════════════════════════════════════ */}
- {/* 통계 카드들 */}
- {/* ═══════════════════════════════════════════════════════════════ */}
- <Suspense fallback={<BiddingsStatsCardsSkeleton />}>
- <BiddingsStatsCardsWrapper promises={promises} />
- </Suspense>
-
- {/* ═══════════════════════════════════════════════════════════════ */}
{/* 메인 테이블 */}
{/* ═══════════════════════════════════════════════════════════════ */}
<Suspense
@@ -92,44 +63,3 @@ export default async function BiddingsPage(props: IndexPageProps) {
</Shell>
)
}
-
-// ═══════════════════════════════════════════════════════════════
-// 통계 카드 래퍼 컴포넌트
-// ═══════════════════════════════════════════════════════════════
-async function BiddingsStatsCardsWrapper({
- promises
-}: {
- promises: Promise<[
- Awaited<ReturnType<typeof getBiddings>>,
- Awaited<ReturnType<typeof getBiddingStatusCounts>>,
- Awaited<ReturnType<typeof getBiddingTypeCounts>>,
- Awaited<ReturnType<typeof getBiddingManagerCounts>>,
- Awaited<ReturnType<typeof getBiddingMonthlyStats>>,
- ]>
-}) {
- const [biddingsResult, statusCounts, typeCounts, managerCounts, monthlyStats] = await promises
-
- return (
- <BiddingsStatsCards
- total={biddingsResult.total}
- statusCounts={statusCounts}
- typeCounts={typeCounts}
- managerCounts={managerCounts}
- monthlyStats={monthlyStats}
- />
- )
-}
-
-// 통계 카드 스켈레톤
-function BiddingsStatsCardsSkeleton() {
- return (
- <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
- {Array.from({ length: 4 }).map((_, i) => (
- <div key={i} className="rounded-lg border p-6">
- <div className="h-4 bg-muted rounded animate-pulse mb-2" />
- <div className="h-8 bg-muted rounded animate-pulse" />
- </div>
- ))}
- </div>
- )
-} \ No newline at end of file